from selenium import webdriver;
import time;
from selenium.webdriver.common.by import By
from selenium.webdriver.support.select import Select

browser = webdriver.Chrome();
time.sleep(5)
browser.get("https://jd.com");
time.sleep(2);
browser.find_element(by=By.LINK_TEXT,value="你好，请登录").click();
time.sleep(5)
browser.find_element(by=By.ID,value="loginname").send_keys("13261713015");
time.sleep(5)
browser.find_element(by=By.ID,value="nloginpwd").send_keys("hu724179");
time.sleep(5)
browser.find_element(by=By.ID,value="loginsubmit").click()
time.sleep(20)
# browser.find_element(by=By.ID,value='uname').send_keys("admin");
# time.sleep(5)
# browser.find_element(by=By.NAME,value="upwd").send_keys("admin");
# time.sleep(5)
# browser.find_element(by=By.CLASS_NAME,value="logingBut").click();
# time.sleep(5)
# function_frmae = browser.find_element(by=By.XPATH,value='/html/frameset/frameset/frame[1]');
# time.sleep(2)
# browser.switch_to.frame(function_frmae);
# time.sleep(2)
# browser.find_element(by=By.LINK_TEXT,value='积分管理').click();
# time.sleep(5)
# browser.switch_to.default_content();
# time.sleep(3)
# content_frame = function_frmae = browser.find_element(by=By.XPATH,value='/html/frameset/frameset/frame[2]');
# time.sleep(2)
# browser.switch_to.frame(content_frame);
# time.sleep(2)
# browser.find_element(by=By.XPATH,value="/html/body/div[1]/center/div/div/form/input[1]").click();
# time.sleep(2)
# browser.find_element(by=By.ID,value="stuname").send_keys("张晓晓");
# time.sleep(2)
# sex_sel = browser.find_element(by=By.ID,value="stusex");
# Select(sex_sel).select_by_index(1);
# time.sleep(2)
# browser.find_element(by=By.ID,value="stuage").send_keys("25");
# time.sleep(2)
# browser.find_element(by=By.ID,value="cardid").send_keys("111111111111114521");
# time.sleep(2)
# browser.find_element(by=By.ID,value="mobilenum").send_keys("11111111111");
# time.sleep(2)
# browser.find_element(by=By.ID,value="parentmobilenum").send_keys("22222222222");
# time.sleep(2)
# browser.find_element(by=By.XPATH,value="/html/body/center/form/table/tbody/tr[7]/td[1]/input").click();
# time.sleep(5)
# browser.find_element(by=By.LINK_TEXT,value="查看详情").click();
# time.sleep(10)
